<?php
//copyright (c) WonderShare
//$Id: index.php 437262 2012-07-27 10:16:22Z xuwh $

define('SITE_PATH', realpath(dirname(__DIR__)) . '/');
define('MODULES_PATH', dirname(dirname(SITE_PATH)) . '/Modules/');
define('APP_PATH', MODULES_PATH . 'protected/');

define('ENVIRONMENT', 'development');//development,testing,production

if(ENVIRONMENT == 'testing' || ENVIRONMENT == 'production'){
    error_reporting(0);
}else{
    error_reporting(E_ALL | E_STRICT);
}

$yii=MODULES_PATH.'framework/yii.php';
require_once($yii);

$cur_domain = $_SERVER['HTTP_HOST'];
$cookie_domain = preg_replace("/([^\.]+)\.(.+)/i",'$2',$cur_domain);
defined('COOKIE_DOMAIN') or define('COOKIE_DOMAIN',$cookie_domain);

$globals=MODULES_PATH.'protected/globals.php';
$config=require(APP_PATH.'config/main.php');


$app=Yii::createWebApplication($config);
require_once($globals);
$app->run();
